import request from '@utils/request.js'

// 登陆
export function login(data) {
  return request({
    url: '/validate-host',
    method: 'post',
    data: data
  })
}

// 获取背景图片
export function getMap(data) {
  return request({
    url: '/get-map',
    method: 'get',
    data: data
  })
}

// 获取天气设置
export function weatherInit() {
  return request({
    url: '/weather/init',
    method: 'get'
  })
}

// 预览天气设置
export function previewWeather(data) {
  return request({
    url: '/weather/preview',
    method: 'post',
    data
  })
}

// 设置阳光
export function weatherSunlight(data) {
  return request({
    url: '/weather/sunlight',
    method: 'post',
    data
  })
}

// 设置雾
export function weatherFog(data) {
  return request({
    url: '/weather/fog',
    method: 'post',
    data
  })
}

// 设置雪
export function weatherSnow(data) {
  return request({
    url: '/weather/snow',
    method: 'post',
    data
  })
}

// 获取几何图形列表
export function getGeometryList() {
  return request({
    url: '/geometry/list',
    method: 'get'
  })
}

// 重命名
export function renameGeometry(data) {
  return request({
    url: '/geometry/rename',
    method: 'post',
    data
  })
}

// 删除几何图形
export function deleteGeometry(data) {
  return request({
    url: '/geometry/delete',
    method: 'post',
    data
  })
}

// 新增几何图形
export function addGeometry(data) {
  return request({
    url: '/geometry/create',
    method: 'post',
    data
  })
}

// 列出 Model ID 和名称关系
export function getObjectModels() {
  return request({
    url: '/object/models',
    method: 'get'
  })
}

// 列出object
export function objectList(data) {
  return request({
    url: '/object/list',
    method: 'get',
    data
  })
}

// 修改object
export function objectUpdate(data) {
  return request({
    url: '/object/update',
    method: 'post',
    data
  })
}

// 删除object
export function objectDelete(data) {
  return request({
    url: '/object/delete',
    method: 'post',
    data
  })
}

// 生成 Object 预览
export function objectGenerate(data) {
  return request({
    url: '/object/generate',
    method: 'post',
    data
  })
}

// 确认 Object 创建
export function objectConfirm(data) {
  return request({
    url: '/object/confirm',
    method: 'post',
    data
  })
}

// 获取camera list
export function cameraList(data) {
  return request({
    url: '/camera/list',
    method: 'get',
    data
  })
}

// 更新camera list
export function cameraUpdate(data) {
  return request({
    url: '/camera/update',
    method: 'post',
    data
  })
}

// 删除camera path
export function cameraDelete(data) {
  return request({
    url: '/camera/delete',
    method: 'post',
    data
  })
}

// 新增point
export function pointAdd(data) {
  return request({
    url: '/camera/current-pose',
    method: 'get',
    data
  })
}

// 新增camera path
export function cameraCreate(data) {
  return request({
    url: '/camera/create',
    method: 'post',
    data
  })
}

// 预览捕获
export function capturePreview(data) {
  return request({
    url: '/capture/preview',
    method: 'post',
    data
  })
}

// 查询状态
export function getCaptureStatus() {
  return request({
    url: `/capture/status`,
    method: 'get'
  })
}

// 开始捕获
export function captureStart(data) {
  return request({
    url: '/capture/execute',
    method: 'post',
    data
  })
}

// 获取捕获状态
export function captureStatus(taskId) {
  return request({
    url: `/capture/status/${taskId}`,
    method: 'get'
  })
}

